Secrecy Capacity Enhancement in Active IRS-Assisted UAV Communication System

As a new technology for reconstructing communication environments, intelligent reflecting surfaces (IRSs) can be applied to UAV communication systems. However, some challenges exist in IRS-assisted UAV communication system design, such as physical layer security issues, IRS design, and power consumption issues owing to the limitation of the hardware. Therefore, a secrecy capacity optimization scheme for an active IRS-assisted unmanned aerial vehicle (UAV) communication system is proposed to solve multi-user security issues. In particular, controllable power amplifiers are integrated into reflecting units to solve the problem of blocked links, and the UAV can dynamically select the served user according to the channel quality. In order to maximize the system average achievable secrecy capacity and ensure the power constraints of the UAV and active IRS, user scheduling, UAV trajectory, beamforming vector, and reflection matrix are jointly optimized, and the block coordinate descent (BCD) algorithm is applied to solve this non-convex problem. Simulation results show that the active IRS-assisted UAV communication scheme can significantly weaken the “multiplicative fading” effect and enhance the system secrecy capacity by 55.4% and 11.9% compared with the schemes with passive IRS and without optimal trajectory, respectively.


Introduction
In wireless communication systems, electromagnetic waves experience different kinds of unpredictable changes in propagating environments, which is difficult to explain and is always considered to be probabilistic. Due to obstacles in the propagation environment, especially in urban areas, the signals will not only be affected by free-space path loss but also be reflected, refracted and scattered, and so on, which will eventually result in significant effects on wireless communication performance. Thus, the controlled meta-surfaces technique is invented to programmatically control the behavior of wireless environments [1]. Meanwhile, it has been proved that programmable meta-surfaces can reshape the amplitude and phase of electromagnetic waves efficiently in real time thanks to the concept of intelligent reflecting surfaces (IRSs) [2]. However, traditional passive IRSs can only achieve negligible gains due to the "multiplicative fading" effect [3].
Unmanned aerial vehicles (UAVs) can effectively improve wireless networks' throughput by making full use of the benefits of line-of-sight (LoS) link transmission and flight flexibility. Moreover, it is anticipated to be a key component of fifth-generation mobile networks to meet the requirement of special scenarios and ubiquitous access [4]. However, in complicated wireless propagation environments, especially in urban areas, the LoS links tend to experience severe deterioration due to the blockage of dense buildings and trees [5].
Fortunately, these challenges can be overcome by deploying IRS in the system since largescale IRS reflecting elements can jointly beamform the signals in a desired direction by adjusting the IRSs parameters [6][7][8].
In addition, the channel response of the legitimate users and the eavesdropper is strongly correlated with the increasing number of access users, which brings a severe physical layer security problem. Saba et al. [9] investigated the secrecy rate in IRS-assisted multiuser multiple-input multiple-output (MIMO) systems and proposed two low-complexity iterative algorithms, namely two-tier and single-loop forms. Zhang et al. [10] studied the energy effectiveness of an active IRS-aided multiple-input single-output (MISO) secure system, assessed the system's energy cost quantitatively, and developed a joint optimization strategy to reduce the energy cost while adhering to the secrecy rate limitation.
Integrating IRS technology into UAV-enabled communication systems can provide intelligent compensation for path loss, reduce interference and build energy-efficient, secure, and robust air-to-ground communications [11]. Saxena et al. [12] investigated the effects of jamming caused by a malicious UAV on the performance of a free-space optical communication system, where a legitimate UAV served as a relay and an IRS was designed to improve the quality of received signals and enlarge the coverage. The overall average bit error rate and outage probability with non-Gaussian additive noise were derived and analyzed. Han et al. [13] proposed a UAV-empowered IRS-backscatter communications network, where a passive IRS acts as the backscatter device and uses the received signals for backscatter communications to guarantee secure transmission. Tang et al. [14] presented an anti-eavesdropping communication scheme to exploit aerial active reflecting and jamming to enhance wireless security in the presence of channel uncertainties at the eavesdroppers. Specifically, a robust optimization approach was employed to tackle the reflecting and jamming designing problem, and the aerial deployment was obtained through deep reinforcement learning (DRL). To increase the secrecy capacity, Pang et al. [15] considered secure transmission issues in IRS-assisted UAV communications by joint optimization of UAV trajectory, beamforming vector, reflecting matrix, etc. However, this research work only took the single-user service case into account, but not for multiple users. In [16], a secure IRS-assisted UAV wireless communication system based on multiple users was proposed. The passive beamforming, ground user association, UAV flight trajectory, and transmit power were jointly optimized to maximize the minimum average secrecy rate of ground users. However, the deployment of passive IRS limited the system security performance improvement.
Additionally, investigations in [6,17] illustrated that UAV-mounted IRS can achieve superior performance and flexibility compared to traditional fixed IRS. A downlink multiuser MISO flying IRS system model was considered in [18]. Additionally, a DRL algorithm named FlyReflect was proposed to jointly optimize the flying trajectory and IRS phase-shift matrix. Truong et al. formulated an optimization problem to maximize the achievable system sum rate by jointly optimizing the flight trajectory and phase-shift matrix of the IRS, and a DRL method was applied to solve it. Nguyen et al. [19] proposed an approach of low complexity for extending network coverage in a massive MIMO communication network, where multiple UAV-mounted IRSs were deployed. Moreover, a DRL method is adopted to jointly optimize the power coefficients and the phase shifts of the multiple IRSs. However, attaching IRSs to the UAV will increase the energy consumption of the UAV. Considering a large reflecting surface, the vibration and wind resistance of the UAV cannot be neglected.
To overcome the "multiplicative fading" effect introduced by passive IRSs, the power amplifier can be integrated into its reflecting units to amplify the reflected signals [20]. Zhang et al. [21] analyzed the performance of active IRSs and demonstrated the effectiveness of active IRSs for the first time. However, the current fully connected architecture of the active IRS consumes additional power, since there are abundant integrated power amplifiers. In contrast to the fully connected architecture, Liu et al. [22] presented a sub-connected architecture in which several units share a single power amplifier and individually regulate their phase shift, considerably reducing the number of power amplifiers, and the new ar-chitecture can achieve improved energy efficiency. In [23], a low-complexity approximated joint precoding algorithm based on alternating optimization was proposed to optimize the beamforming and active reflector matrix, which further demonstrated the practicability of active intelligent reflection in secure transmission. However, the amplification of noise by its active IRS was neglected, which makes the optimal solution inconsistent with the actual solution. Nguyen et al. [24] considered a novel hybrid active/passive IRS-assisted UAV communications system. The hybrid IRS was equipped with a few active elements, which not only reflect but also amplify the incident signals for significant performance improvement. To maximize the minimum rate among users, the location, and power allocation of the UAV and the IRS reflecting/amplifying coefficients were jointly optimized. The application of hybrid IRS enables improved system performance without additional power consumption. For better comparison, the crucial parameters and optimization methods of reviewed works [13][14][15][16]23,24] are provided in Table 1. In general, there has been a fair amount of study on IRS-assisted UAV secure communication systems, but rare studies have considered both active IRS adjustment and multi-user services at the same time. The authors of [14,24] only discuss the location of UAVs, without considering the impact of UAV trajectory on the communication environment. In addition, few works have considered both the use of active IRSs and relevant energy constraints. Therefore, an active IRS-assisted UAV multi-user communication system is established, where multiple users are deployed on the ground and time division multiple access (TDMA) is applied as an access scheme to the network. Specifically, in urban scenarios with dense buildings and trees, where the LoS links between the UAV and ground users are often blocked, we deploy active IRS on building surfaces to enhance system security. With the objective of maximizing the average secrecy capacity, which can be represented by the average secrecy rate, user scheduling, UAV trajectory, multi-antenna beamforming, and the amplitude and phase of IRS are jointly optimized. The main contributions of this paper are summarized as follows:

•
We present an IRS-assisted UAV multi-user communication system model, where the UAV can dynamically select the best user for service within each time slot according to its channel conditions. Considering the presence of passive eavesdroppers and the LoS link being blocked between the UAV and legitimate users, the user scheduling, UAV trajectory, beamforming vector, and the reflecting matrix of IRS are jointly optimized to maximize the average achievable secrecy capacity during the flight.

•
The formulated non-convex optimization problem is first divided into four subproblems. However, the sub-problems are still challenging to solve due to fractional and non-convex objectives. Hence, successive convex approximation (SCA) technology is applied in this paper to transform the trajectory optimization sub-problem into a convex form. Furthermore, the sub-problems of beam design and IRS control are transformed into a convex problem by applying the Charnes-Cooper transformation (CCT) method and the majorization-minimization (MM) algorithm, respectively. In order to tackle the aforementioned sub-problems and obtain the sub-optimal solution, we finally introduce the block coordinate descent (BCD) approach.

•
Simulation results validate the effectiveness of the proposed scheme and show that the secrecy capacity increased compared with the schemes with passive IRS and without optimal trajectory, respectively. It is shown that the active IRS-aided UAV scheme is efficient in reducing the impact of the "multiplicative fading" effect in secure communication systems. Figure 1 depicts a model of an active IRS-assisted UAV secure communication system. The UAV serves multiple users as a mobile base station, but a passive eavesdropper exists in the environment at the same time. In addition, we assume that the UAV can access the position of both legitimate users and eavesdroppers based on infrared detection. For clarity, the utilized notations are summarized in Table 2.  We present an IRS-assisted UAV multi-user communication system model, where the UAV can dynamically select the best user for service within each time slot according to its channel conditions. Considering the presence of passive eavesdroppers and the LoS link being blocked between the UAV and legitimate users, the user scheduling, UAV trajectory, beamforming vector, and the reflecting matrix of IRS are jointly optimized to maximize the average achievable secrecy capacity during the flight.

•
The formulated non-convex optimization problem is first divided into four sub-problems. However, the sub-problems are still challenging to solve due to fractional and non-convex objectives. Hence, successive convex approximation (SCA) technology is applied in this paper to transform the trajectory optimization sub-problem into a convex form. Furthermore, the sub-problems of beam design and IRS control are transformed into a convex problem by applying the Charnes-Cooper transformation (CCT) method and the majorization-minimization (MM) algorithm, respectively. In order to tackle the aforementioned sub-problems and obtain the sub-optimal solution, we finally introduce the block coordinate descent (BCD) approach.

•
Simulation results validate the effectiveness of the proposed scheme and show that the secrecy capacity increased compared with the schemes with passive IRS and without optimal trajectory, respectively. It is shown that the active IRS-aided UAV scheme is efficient in reducing the impact of the "multiplicative fading" effect in secure communication systems. Figure 1 depicts a model of an active IRS-assisted UAV secure communication system. The UAV serves multiple users as a mobile base station, but a passive eavesdropper exists in the environment at the same time. In addition, we assume that the UAV can access the position of both legitimate users and eavesdroppers based on infrared detection. For clarity, the utilized notations are summarized in Table 2.

Channel Model
A three-dimensional Cartesian coordinate system is established, J ground legitimate users and a single passive eavesdropper are distributed in a stationary area. Let the horizontal coordinate of the j-th legitimate user Bj and active IRS be w Bj = x Bj , y Bj and w I = [x I , y I ], respectively. Based on infrared detection, the UAV can obtain the eavesdropper's location w E = [x E , y E ]. This paper adopts the access mode of TDMA and the full cycle time T is discretized into N equal time slots, i.e., T = Nδ, where δ is the length of the unit time slot and multiple legitimate users will occupy different time slots. Since the time slot is small enough, the position of the UAV can be considered unchanged [25]. In addition, it is assumed that IRS has a fixed height H I and the UAV's flight height is fixed at H U . The horizontal position of the UAV in the n-th time slot can be stated as Then, the following constraints need to be satisfied. where the constraints in (1) state that the maximum flight rate V max of the UAV restricts the maximum movement of the UAV in δ. The UAV flies with the predetermined initial position q I and final position q F . Moreover, the UAV's vibration can be disregarded because of its small size. The active IRS is equipped with a uniform plane array (UPA) of K reflecting elements, a controller intelligently changing the phase shift and amplification of each element, while the UAV is equipped with M antennas and both legitimate users and eavesdropper are equipped with a single omnidirectional antenna. Let the phase-shift matrix The enhanced signal by the active IRS can be expressed as: where x is the transmitted signal and P = diag(p 1 , · · · , p K ) denotes the amplification factor matrix. Thanks to the integrated reflection-type amplifier, each element p k can be larger than one but not larger than η k . It can be seen from (4) that the reflector amplifies not only the useful signal x but also the noise v, it will bring new static noise n s . Considering that PΘ always appears in a coupled fashion, let ψ = PΘ = p 1 e jθ 1 , · · · , p K e jθ K H , Ψ = diag(ψ).
Assuming the UAV serves only one user in a time slot, α j [n] = 1 indicates that Bj is served in the n-th time slot, otherwise α j [n] = 0, we can obtain the following constraints: We assume that the channel quality predominantly depends on the UAV-IRS distance since the air-to-ground communication channels are mainly dominated by the LoS links [26]. Particularly, it is presumed that the receivers will properly compensate for the Doppler effect brought on by the UAV's motion [27]. Unlike a uniform linear array (ULA) at the UAV, we utilize a UPA at the IRS in this paper. Additionally, the active IRS consists of N = N y × N z elements and UAV is equipped with M antennas. The total array response of the corresponding channel can be seen as the product of the array response of receivers and that of the transmitter [28]. Therefore, the channel modeling is characterized as the product channels [7].
where ρ 0 denotes the channel gain at the reference distance D 0 = 1m, assuming the path loss exponent related to the U−I link is 2, d U I [n] = q[n] − w I 2 + (H U − H I ) 2 denotes the distance between the UAV and the active IRS in the n-th time slot, a N (θ, η) and a M (γ) are the array responses of IRS and transmitter of UAV, λ is the wavelength, d is the antenna separation, and d 0 is the separation of elements at the IRS. θ AoA [n] and η AoA [n] represent the azimuth and elevation angle of arrival (AoA) of the signal from the UAV to the IRS in the n-th time slot, respectively. Additionally, γ AoA [n] denotes the angle of departure (AoD) associated with the UAV in the n-th time slot.  [3,7,13] is adopted, the channel gain h IBj [n] can be expressed as where α is the path loss exponent corresponding to the I − Bj link, d IBj = w I − w Bj 2 + H 2 I denotes the distance between the active IRS and Bj, and κ is the Rician factor. The LoS component can be calculated as h LoS is the random scattering component independently modeled by a zero mean and a unitvariance circularly symmetric complex Gaussian (CSCG) random variable. h IE [n] can be modeled in the same way.
In actual implementations, copious obstructions in the complicated urban environment may hinder the LoS path of the UAV to the user, while the wireless channel is still replete with extensive scatters [29]. The channel coefficients of U − Bj/E link are given by where β is the path loss exponent of U denotes the distance from the UAV to the served user and passive eavesdropper, respectively. h[n] is modeled as a CSCG distribution with zero mean and unit variance.

Secrecy Capacity Model
The received signal of the legitimate user Bj and the eavesdropper in the n-th time slot can be given as follows, respectively.
where x[n] is the transmitted signal; w[n] ∈ C M×1 denotes the beamforming vector at the UAV; n I ∼ CN 0, σ 2 I , n B ∼ CN 0, σ 2 B , and n E ∼ CN 0, σ 2 E , respectively, represent the noise introduced by IRS, user Bj, and eavesdropper; σ 2 I , σ 2 B , and σ 2 E represent the noise power. The SINR of the legitimate user Bj and the eavesdropper in the n-th time slot, respectively, are given as: The static noise n s introduced by the IRS in (4) is independent of Ψ and relatively small, and can be omitted. Hereto, the system's average secrecy capacity during flight time can be described as where

Power Consumption Model
Assuming the UAV flies at a constant power P f ly , and the total power consumption of UAV in the n-th time slot is expressed as follows: where ξ is the reciprocal of the energy conversion coefficient at the transmitter of the UAV. The maximum transmitting power of the UAV at any time slot during the flight cycle shall not exceed the upper limit of the transmitting power of the antenna P U .
The active IRS amplifies not only useful signals but also useless ones, thus the total energy consumption of the active IRS in the n-th time slot is expressed as where ζ is the reciprocal of the energy conversion coefficient at the transmitter of the active IRS. P irs and P amp constitute the hardware static power of the active IRS, which corresponds to the phase shift and amplifier, respectively. The fully connected architecture is adopted in the active IRS, i.e., L = K. Specifically, P IRS [n] must not exceed the upper limit of the active IRS P A , i.e., P IRS [n] ≤ P A , ∀n.
The optimization problem (P1) is formulated as where η k denotes the maximum magnification at the k-th reflecting element. The optimization problem (P1) is a non-convex problem and there is a tight coupling among the optimization variables W, Ψ, and Q. In addition, the power constraint and maximum amplification of the IRS should be considered while optimizing the phase factor and amplification factor of the IRS. The channel of the auxiliary communication system of the active IRS is the sum of a direct link and cascade channel, and the active IRS will introduce extra noise. Moreover, the objective function is the difference between the two rates and makes the objective function difficult to solve.

Joint Optimization Algorithm
Note that if the value of R sec is negative in the n-th time slot, we can control the transmit beamforming vector w[n] = 0, resulting in R sec = 0. Thus, by modifying the beamforming vector, we can ensure that the secrecy capacity is never negative. In this case, it is possible to omit the operator [ · ] + without affecting the result. Even so, the objective function of the original problem is non-convex and contains non-convex constraints, making it challenging to solve. Considering the coupling relationship among variables, the BCD algorithm is applied to decompose the original problem into four sub-problems: user scheduling, trajectory optimization, beamforming design, and active IRS control. For the first sub-problem, we choose the best user by comparing the overall channel conditions. The locally optimal trajectory solution can be obtained in the second sub-problem. In the beamforming design problem, the variables about beamforming always exist in quadratic terms. We first converted the problem by the semidefinite relaxation (SDR) algorithm and solved the fractional programming problem after transformation by CCT. Similarly, in the IRS designing problem, the SDR algorithm is applied first and the MM algorithm is used to relax the transformed non-convex objective function. The flow chart of the joint optimization algorithm is shown in Figure 2.

User Scheduling Optimization
For the given UAV trajectory Q, beamforming vector W, and reflecting matrix Ψ, the transmission rate of eavesdroppers is settled. Thus, the average secrecy capacity is dependent entirely on the downlink rate of legitimate users. The problem (P1) can be rewritten by By finding max(R Bc [n]) and setting the corresponding scheduling α c [n] = 1, the rest α j [n] = 0, j / ∈ c, then the optimal scheduling can be expressed as problem. In the beamforming design problem, the variables about beamforming always exist in quadratic terms. We first converted the problem by the semidefinite relaxation (SDR) algorithm and solved the fractional programming problem after transformation by CCT. Similarly, in the IRS designing problem, the SDR algorithm is applied first and the MM algorithm is used to relax the transformed non-convex objective function. The flow chart of the joint optimization algorithm is shown in Figure 2.

Trajectory Optimization
With given user scheduling S, beamforming vector W, and reflecting matrix Ψ, the trajectory optimization sub-problem can be formulated as However, it is difficult to deal with (27) and (28) Then, R Bj [n] can be reformulated as follows: The original sub-problem can be written as Moreover, the constraints (33b) and (33c) are convex with respect to {ν k [n], ∀n} and {ω k [n], ∀n}, and the right parts in (30) and (31) are convex with respect to q[n], and can also be relaxed to its lower-bound by the first-order Taylor expansion, which can be given by Bringing them to (33b), (33c), (30), and (31), respectively, the problem (P3.1) can be approximated as (1), (2), (3), (21), (29).
Thus far, (P3.2) is a standard convex problem that can be solved with the CVX tool.

Beamforming Optimization
Given user scheduling S, UAV trajectory Q, and reflecting matrix Ψ, the beamforming design sub-problem can be expressed as Since the cascaded channel of the problem is extremely complex and the fixed power consumption in the constraint is known, the fixed parts can be given by (44)-(49): Since the log formula is monotonous, the solution of the original problem will not be changed by omitting it, then the original sub-problem can be expressed as  ≤ 0, where λ max (X) is the largest eigenvalue of X, tr(X) represents the eigenvector corresponding to the largest eigenvalue of X. By constructing the penalty function, the objective function of this sub-problem is converted as follows: Problem (P4.4) can be properly optimized through the CVX solver. Given S, Q, and Ψ, the log function in (P4) can be omitted because of its monotonicity. In objective functions and constraints, the variable W always appears in quadratic form. Adopting the SDR algorithm, the problem is transformed by constructing Y[n] = w[n]w H [n] and the CCT method is used to solve the fractional programming problem (P4.2). It is worth noting that the rank-one constraint is introduced into SDR, so the penalty Λ w is constructed to recover the original variable as much as possible. The logic of the penalty-based recovery rank-1 algorithm is shown in Algorithm 1. By iteratively solving problem (P4.4) optimally, we can monotonically tighten the upper bound of (53). Penalty Λ w is updated to guarantee the rank-one constraint.

Active IRS Optimization
For given user scheduling S, UAV trajectory Q, and beamforming vector W, the sub-problem of optimizing Ψ can be expressed as Here, C V; V is a surrogate function, after dropping the constant term, the beamforming design problem can be recast into a convex form as (56b), (56c), (56d), (56e).
Algorithm 2 demonstrates the algorithm's rationale. The SDR algorithm is adopted to convert the original sub-problem into an SDP format. Applying the MM algorithm, a surrogate function is constructed to replace the objective function in (P5.1). By iteratively solving problem (P5.2) optimally, the convergence of C(V) promised. In each iteration, the penalty-based method is applied to recover the rank-1 solution.
Algorithm 2 Active IRS Control Algorithm for Problem (P5).

Overall Algorithm Description
The overall algorithm for solving the issue (P1) is outlined in Algorithm 3, where the BCD algorithm is applied, in accordance with the results gained in the previous four sub-problems. The original problem's sub-optimal solution is found by solving the subproblems in turn.
(P4.4) is an approximate solution to the sub-problem obtained from the decomposition of the original problem, and the convergence analysis of the BCD method cannot be applied directly. The convergence of Algorithms 1 and 2 are proved in Appendices A and B, respectively. (1): Initialization: maximum threshold 4 > 0, feasible point Q (0) , W (0) , Ψ (0) and iteration r = 1.
The computational complexity of solving (P2) is expressed as O(N(J + 1)), the computational complexity of using the SCA algorithm for (P3) is O (10N) 3.5 [31], and the computational complexity of solving semidefinite programming problems for (P4) and (P5) is expressed as O N M 3 and O N(K + 1) 3 [32], respectively. Thus, the complexity of the overall algorithm is O R ite N(J + 1) + (10N) 3.5 + N M 3 + N(K + 1) 3 , where R ite indicates the total number of iterations [33].

Analysis of Simulation Results
This section presents numerical findings to demonstrate the effectiveness of the suggested joint optimization scheme based on an active IRS-aided UAV system in improving the system's average secrecy capacity. In this section, we present simulation results to show the performance of the proposed secure transmission scheme. Specifically, we assume that the ground area is 500 × 500 m, where the fixed height of the UAV is 50 m with a maximum speed V max = 15 m/s, the starting position is at the origin, and the flight endpoint of the UAV is (500, 500) T m. We consider a scenario where a M = 4 antenna UAV and a K = 16 element active IRS are employed to cooperatively serve the J = 4 legitimate users, whose positions are (50, 200) T m, (250, 100) T m, (400, 100) T m, and (450, 400) T m, respectively. The active IRS adopts a fully connected architecture, which means there are L = 16 amplifiers. The antenna arrays of the UAV and the active IRS are assumed to be a uniform linear array and UPA, respectively, where the antenna spacings are both λ/2, λ is the frequency of the carrier wave. The position of the single passive eavesdropper is (500, 200) T m. There are also fixed active IRSs located at (350, 150) T m with a height of 10 m. The UAV flies at a constant power P f ly = 29.7 dBm, the hardware static power of the active IRS, which corresponds to the phase shift and amplifier are P irs = P amp = 10 dBm, the maximum power budget at UAV and active IRS are P U = P A = 30 dBm, δ = 1 s is the time slot. Moreover, σ 2 I , σ 2 B , σ 2 E = −110 dBm and α = 2.2, β = 2.5, κ = 3, ρ 0 = −30 dBm, are the power of AWGN, the path loss exponent, the Rician factor, and the reference channel gain, respectively. The default simulation parameters are shown in Table 3 unless otherwise specified.  Figure 3 illustrates the distribution of four legitimate users, the eavesdropper as well as the active IRS, and plots the optimal trajectory of the UAV under different flight time conditions. Due to the "multiplicative fading" effect introduced by IRS, the UAV can balance the cascaded channel conditions by flying around the IRS and legitimate users and away from eavesdroppers, providing a safer quality of communication for legitimate users. Four situations are represented as four actual scenarios: for the original strategy, the UAV can only fly in an approximately straight path; when T = 60 s, the UAV will try to fly to the best location to serve each legitimate user; when T = 80 s, the UAV can reach each optimal location and stay appropriately; when T = 100 s, the UAV will stay in the optimal location longer, providing a safer and better quality of service to legitimate users. Figure 4 shows the time allocation and scheduling of four users in each time slot. In order to maximize the average secrecy capacity, the UAV should select appropriate users to transmit signals. It is shown that at the beginning, user-1 can obtain a higher secrecy rate and be selected. Until the 16th slot, user-2 can have a more secure communication environment due to the changes in UAV position, beamforming, and reflection parameters of the IRS, so user-2 becomes the served user. Once a user is selected for service, the UAV will send signals to that the user to obtain the maximum average secrecy capacity. In a multi-user scenario where time is sufficient, the UAV will first select the service user Bj (k) and fly to the optimal location. Taking the flight constraints into account, the UAV will stay for an appropriate amount of time and fly to the next optimal position, simultaneously sending a signal to Bj (c+1) as so on until it reaches the destination. away from eavesdroppers, providing a safer quality of communication for legitimate users. Four situations are represented as four actual scenarios: for the original strategy, the UAV can only fly in an approximately straight path; when = 60 s, the UAV will try to fly to the best location to serve each legitimate user; when = 80 s, the UAV can reach each optimal location and stay appropriately; when = 100 s, the UAV will stay in the optimal location longer, providing a safer and better quality of service to legitimate users.  Figure 4 shows the time allocation and scheduling of four users in each time slot. In order to maximize the average secrecy capacity, the UAV should select appropriate users to transmit signals. It is shown that at the beginning, user-1 can obtain a higher secrecy rate and be selected. Until the 16th slot, user-2 can have a more secure communication environment due to the changes in UAV position, beamforming, and reflection parameters of the IRS, so user-2 becomes the served user. Once a user is selected for service, the UAV will send signals to that the user to obtain the maximum average secrecy capacity. In a multi-user scenario where time is sufficient, the UAV will first select the service user ( ) and fly to the optimal location. Taking the flight constraints into account, the UAV will stay for an appropriate amount of time and fly to the next optimal position, simultaneously sending a signal to ( ) as so on until it reaches the destination.   Figure 5 shows a comparison between the suggested scheme and the other two benchmarks in terms of the average secrecy capacity with respect to various values of in (44), which is equivalent to the transmitting power. We considered a scenario where a = 4 antenna UAV and a = 16 element active IRS are employed cooperatively. In addition, it is worth noting that for the active scheme is used for transmitting antennas and the same power for reflecting signals, while for the passive schemes 2 * is used for transmitting signals. It is shown that the rate of all schemes will increase with the increase in to varying degrees.   Figure 5 shows a comparison between the suggested scheme and the other two benchmarks in terms of the average secrecy capacity with respect to various values of P U in (44), which is equivalent to the transmitting power. We considered a scenario where a M = 4 antenna UAV and a K = 16 element active IRS are employed cooperatively. In addition, it is worth noting that for the active scheme P U is used for transmitting antennas and the same power P U for reflecting signals, while for the passive schemes 2 * P U is used for transmitting signals. It is shown that the rate of all schemes will increase with the increase in P U to varying degrees. For example, at P U = 18 dBm, the active IRS achieves an improvement of 55.4% and 61.7% compared to the case with passive IRS and without IRS, respectively. By jointly optimizing user scheduling, UAV trajectory, beamforming, and the reflecting matrix, the proposed joint optimization strategy can outperform the benchmark schemes in terms of average secrecy capacity, proving that it is an efficient way to enhance security performance.

Performance Comparison of Different Optimization Algorithms
The convergence of the proposed joint optimization algorithm (Algorithm 3) and the benchmark algorithm is depicted in Figure 7. The average secrecy capacity scheme under consideration is 11.9% higher than the benchmark without optimal trajectory. Additionally, the method converges after roughly 30 rounds. Average secrecy rate (bps/Hz) Average secrecy rate (bps/Hz) Figure 5. Average secrecy capacity of different schemes with respect to P U . Figure 6 shows the curve of the performance of the average security capacity with different settings of the number of IRS reflector units K and the number of antennas of UAV M. The transmit power P U = 18 dBm. As can be seen from the figure, our scheme can achieve acceptable performance in the above three settings. By comparing the curve of the (K = 16, M = 4) and (K = 9, M = 4) schemes, we can find that the average secrecy capacity will increase significantly with the increase in K, since more reflecting units can better align the signal to the served user. By comparing the curve of the (K = 9, M = 6) and (K = 9, M = 4) schemes, it is verified that the beamforming capability was also improved to some extent by increasing M, with a further improvement in secure communication performance.

Conclusions
This paper established a model for an active IRS-assisted UAV communication system where the UAV can dynamically select a user for service in each time slot based on its channel conditions. To maximize the average achievable secrecy capacity for the whole flight, the user scheduling, UAV trajectory, transmitting beamforming, and reflecting matrix are jointly optimized. However, the established problem was challenging to solve because of the objective non-convex function and tightly coupled variables. Therefore, an algorithm based on BCD is adopted to solve it. Initially, we decoupled the original issue Average secrecy rate (bps/Hz)

Conclusions
This paper established a model for an active IRS-assisted UAV communication system where the UAV can dynamically select a user for service in each time slot based on its channel conditions. To maximize the average achievable secrecy capacity for the whole flight, the user scheduling, UAV trajectory, transmitting beamforming, and reflecting matrix are jointly optimized. However, the established problem was challenging to solve because of the objective non-convex function and tightly coupled variables. Therefore, an algorithm based on BCD is adopted to solve it. Initially, we decoupled the original issue into four sub-problems, and then the SCA technique, CCT method, and MM algorithm were applied to convert the original sub-problems into convex forms. Furthermore, we solved the above four sub-problems alternately based on the BCD algorithm and finally obtained the equivalent solution of the original problem. Numerical results show that the active IRS-assisted UAV communication scheme can efficiently weaken the effect of the "multiplicative fading" and significantly improved the secrecy capacity. In future research, we will consider the issues of IRS discrete designing and new advanced multi-access techniques for next-generation networks, such as NOMA and RSMA. Moreover, the DRL algorithm can be applied to solve the related optimization problems.

Data Availability Statement:
The data presented in this study are available in Table 3.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The

Appendix B
For any concave function, we have where C V; V is a surrogate function since four key conditions hold [34]: and are continuous in V and V. According to the key property of the MM algorithm, the convergence of Algorithm 2 is guaranteed.